/**
 * 
 */
package game.rwalk.entity;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Rect;

/**
 * @author sk8erboi
 *
 */
public class Cell {
	
	private int color;
	private Rect scope = new Rect();

	public Bitmap bitmap;
	
	private int[] ids;
	private Context mContex;

	//contructor
	public Cell(int[] ids, int id, Context mContex) {
		this.ids = ids;
		color = id;
		this.mContex = mContex;
		
		bitmap = BitmapFactory.decodeResource(mContex.getResources(), ids[id]);
	}
	
	//chang color in advance play mode
	public void changeColor(int color) {
		this.color = color;
	}
	
	//change color after player chose it
	public void changeActiveColor(boolean active) {
		if(active) {
			bitmap = BitmapFactory.decodeResource(mContex.getResources(), ids[color + 3]);
		} else {
			bitmap = BitmapFactory.decodeResource(mContex.getResources(), ids[color]);
		}
	}
	
	public int getColor() {
		return color;
	}
	
	public Rect getScope() {
		return scope;
	}

	public void setScope(Rect scope) {
		this.scope = scope;
	}
}
